package cn.jy.erp.domain;

import java.util.ArrayList;
import java.util.List;
/**
 * 菜单实体类
 * @author sh
 *
 */

public class Menu {
	private Long id;
	private String sn;
	private String name;
	private String icon;
	private String url;
	private String intro;
	//父菜单--自连接 多对一
	private Menu parent;
	//子菜单--自连接 一对多
	private List<Menu> children = new ArrayList<Menu>();
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getSn() {
		return sn;
	}
	public void setSn(String sn) {
		this.sn = sn;
	}
	public String getName() {
		return name;
	}
	
	/**
	 * 兼容EasyUI comoTree 中的传参
	 * @return
	 */
	public String getText() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getIntro() {
		return intro;
	}
	public void setIntro(String intro) {
		this.intro = intro;
	}
	public Menu getParent() {
		return parent;
	}
	public void setParent(Menu parent) {
		this.parent = parent;
	}
	
	
	public List<Menu> getChildren() {
		return children;
	}
	public void setChildren(List<Menu> children) {
		this.children = children;
	}
	@Override
	public String toString() {
		return "Menu [id=" + id + ", sn=" + sn + ", name=" + name + ", icon=" + icon + ", url=" + url + ", intro="
				+ intro + ", parent=" + parent + ", children=" + children + "]";
	}
	
	
}
